{% extends 'layout.html' %}
{% block content %}
<div class="container">
    <h2>订单商品列表</h2>
    <table class="table table-striped">
        <thead>
            <tr>
                <th>商品图片</th>
                <th>商品名称</th>
                <th>商品编码</th>
                <th>单价</th>
                <th>数量</th>
                <th>小计</th>
            </tr>
        </thead>
        <tbody>
            {% for order_good in order_goods %}
            <tr>
                <td><img src="{{ order_good.goods_info.goods_img.url }}" width="50" height="50"></td>
                <td>{{ order_good.goods_info.goods_name }}</td>
                <td>{{ order_good.goods_info.goods_code }}</td>
                <td>{{ order_good.goods_info.goods_price }}</td>
                <td>{{ order_good.goods_num }}</td>
                <td>{{ order_good.goods_info.goods_price|multiply:order_good.goods_num }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}